<template>
  <el-tabs v-model="activeName" @tab-click="handleClick" style="margin-left: 30px;">
    <el-tab-pane label="M30+客户" name="first">
      <el-table :key="tableKey" v-loading="listLoading" :data="first_data" size="mini" border fit highlight-current-row style="width: 100%;">
          <el-table-column label="M30+客户" align="center" >
            <template slot-scope="{row}">
              <span>{{ row.month }}</span>
            </template>
          </el-table-column>

          <el-table-column label="放款笔数" align="center">
            <template slot-scope="{row}">
              <span>{{ row.new_number }}</span>
            </template>
          </el-table-column>

          <el-table-column label="放款金额" align="center">
            <template slot-scope="{row}">
              <span>{{ row.new_project_money }}</span>
            </template>
          </el-table-column>   
          <el-table-column  v-for="(item,index) in mob" :label="item" align="center">
            <template slot-scope="{row}" >
              <span >{{row.mob[item]}}</span>
            </template>
          </el-table-column>
          
       

         
          
      </el-table>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import {
  financeExcelVintage
} from '@/api/finance_excel'
import waves from '@/directive/waves' // waves directive

import Pagination from '@/components/Pagination' // secondary package based on el-pagination
export default {
  name: 'ReceiveTable',
  components: {
    Pagination
  },
  directives: {
    waves
  },
  data() {
    return {
      listLoading: true,
      tableKey: 0,
      activeName: 'first',
      first_data:[],
      mob:[],
    }
  },

  created(){
    this.financeExcelVintage(1)
  },
  methods: {
    handleClick(tab) {
        if(tab.name=='first'){
          this.financeExcelVintage(1)
        }
        if(tab.name=='second'){
          this.financeExcelVintage(2)
        }
        if(tab.name=='third'){
          this.financeExcelVintage(3)
        }    
    },
   
    //数据
    financeExcelVintage(lab){
      let pam = {lab:lab}
      financeExcelVintage(pam).then(response => {
        this.listLoading = false
        this.first_data = response.data.list
        this.mob = response.data.mob
      })
    },
   
    //导出
    excelout() {
      merchantdayexcelout(this.infoQuery).then(response => {
        this.listLoading = false
        const filepath = response.data.path
        window.location.href = filepath
      })
    },

  }
}
</script>

<style>
</style>
